Skip to content

feat(rendition): carry local unit counts through Mistral OCR - #261

Merged
wesm merged 4 commits into
kenn-io:mainfrom
rodboev:pr/175-mistral-bounded-nonpdf
Sep 6, 2026
Merged

feat(rendition): carry local unit counts through Mistral OCR#261
wesm merged 4 commits into
kenn-io:mainfrom
rodboev:pr/175-mistral-bounded-nonpdf

Conversation

@rodboev

@rodboev rodboev commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

The Mistral OCR path accepted output without checking that the provider returned the number of text units the local inspection counted, and the Mistral seam was not ready to claim authority for non-PDF formats. It now carries the verified local unit count through rendition snapshots and compares it with the returned units before output is accepted, leaving the seam ready for non-PDF authority once provider evidence proves the unit semantics.

Unrecognized, malformed, over-limit, and unproved formats continue to fail closed; the existing PDF authority, exact-byte checks, and consent boundary remain unchanged. Callers that need a non-PDF input today must convert it to PDF, while provider evidence is recorded from synthetic inputs or a credentialed probe rather than inferred from hand-written responses.

The change stays inside the Mistral provider adapter and bounded format inspection; other providers, storage, daemon, API, CLI, and UI surfaces remain unchanged.

Refs #175

Exercise the Mistral rendition path with a provider-authenticated local-exact
format fixture, including local unit counting, snapshot propagation, and
provider unit equality.
@roborev-ci

roborev-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown

roborev: Combined Review (7d6048c)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 4m25s

@rodboev rodboev changed the title Authorize bounded non-PDF Mistral OCR inputs feat(rendition): authorize bounded non-PDF Mistral OCR inputs Sep 4, 2026
@wesm wesm self-assigned this Sep 6, 2026
@wesm

wesm commented Sep 6, 2026

Copy link
Copy Markdown
Member

looking

Local-exact responses already undergo count validation in the OCR client.
Keep the rendition-level comparison focused on PDFs, which use a different
validation method, and share the source count bounds check.

Keep the synthetic DOCX test explicit about its temporary authority and
verify that a provider count mismatch is rejected. This prepares the
rendition path without enabling any new production input formats.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@wesm wesm changed the title feat(rendition): authorize bounded non-PDF Mistral OCR inputs feat(rendition): carry local unit counts through Mistral OCR Sep 6, 2026
@wesm

wesm commented Sep 6, 2026

Copy link
Copy Markdown
Member

I checked the findings and made the small cleanups. The title now says that this PR carries local unit counts through Mistral OCR. It does not enable any new non-PDF formats.

The extra non-PDF mismatch check was redundant: the OCR client rejects that response earlier. I restored the PDF-only check and combined the duplicated source-count validation while preserving the PDF error messages. The DOCX test now builds its ZIP once and checks both a matching response and rejection of three units against a local count of two.

I kept the temporary test registration inline and documented that this test must stay sequential. A one-use helper would not enforce that constraint. I also kept the registry test, with a note that it guards future registrations and currently has no registered counters to exercise.

Pushed in b8caef1. The full Go suite passed with CGO enabled and disabled; the Mistral race test, lint, and prek checks also passed.

@roborev-ci

roborev-ci Bot commented Sep 6, 2026

Copy link
Copy Markdown

roborev: Combined Review (b8caef1)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 3m11s

@wesm
wesm merged commit 9d7401c into kenn-io:main Sep 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants